package com.mz.ozy.mvp.model;


import android.app.Activity;
import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * @author
 * @date 2018/7/25
 * @description
 */
public class IdyllicPastureModel {


    public Observable<ResponseBody> getInfo(Activity activity, String pageNo) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", pageNo);
        maps.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(activity).post(Constants.TransCode.TransCode10069, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> getPopInfo(Activity activity, String pageNo) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", pageNo);
        maps.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(activity).post(Constants.TransCode.TransCode10075, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> getPopDetailInfo(Context activity, String id, String pageNo) {
        Map<String, String> maps = new HashMap<>();
        maps.put("id", id);
        maps.put("pageNo", pageNo);
        maps.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(activity).post(Constants.TransCode.TransCode10076, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    public Observable<ResponseBody> getInfoDetail(Context context, String id) {
        Map<String, String> maps = new HashMap<>();
        maps.put("id", id);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10068, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
}
